﻿using ModularAndPlugin.Core.Composition;
using UI.Web.MVC.VollPlugin;

namespace UI.Web.MVC.Moduls.Sport.Controllers
{
    using System.ComponentModel.Composition;
    using System.Web.Mvc;


    [Export(typeof(IController)), ExportMetadata("Name", "Sport")]
    public class SportController : Controller
    {
        #region Fields
        [Import]
        public IVollPlugin VollPlugin;
        #endregion

        #region Actions
        [Authorize]
        public ActionResult Index()
        {
            return Content(GetContent());
        }

        [HttpGet]
        public ActionResult GoSetVal(string v)
        {
            VollPlugin.FildValue = v;
            return Content("您设置的测试串为：" + v);
        }
        #endregion

        #region Method
        [CommandAttibute("GetVollContent")]
        public string GetContent()
        {
            var voll = VollPlugin.CreateVoll();
            return voll.Title;
        }
        #endregion
    }
}
